import Vue from 'vue'
import Router from 'vue-router'
import login from '@/view/login'
import Home from '@/view/Home'
import User from '@/view/user/User'
import Manage from '@/view/cateManage/Manage'
import ManageByfirst from '@/view/cateManage/ManageByfirst'
import ManageBysecond from '@/view/cateManage/ManageBysecond'
import GoodsManage from '@/view/goodsManage/GoodsManage'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: {name: 'Login'}
    },
    {
      path: '/login',
      name: 'Login',
      component: login
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children: [
        {
          path: '/user',
          name: 'User',
          component: User
        },
        {
          path: '/manage',
          name: 'Manage',
          component: Manage,
          redirect: {name: 'ManageByfirst'},
          children: [
            {
              path: '/manageByfirst',
              name: 'ManageByfirst',
              component: ManageByfirst
            },
            {
              path: '/manageBysecond',
              name: 'ManageBysecond',
              component: ManageBysecond
            }
          ]
        },
        {
          path: '/goodsManage',
          name: 'GoodsManage',
          component: GoodsManage
        }
      ]

    }
  ]
})
